package org.bbs.demo.concern.dao;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.bbs.demo.concern.dto.ConcernDto;
import org.bbs.demo.user.model.User;

@Mapper
public interface AddConcernDao {
    @Insert("insert into follower(follow_id,user_id,special) values(#{follow_id},#{user_id},#{special})")
    public int addConcern(ConcernDto concernDto);

    @Select("select * from follower where follow_id = #{follow_id} and user_id = #{user_id}")
    public ConcernDto findConcern(ConcernDto concernDto);

    @Select("select * from bbsusers where user_id = #{user_id}")
    public User findUser(String user_id);

    @Update("update follower set special = #{special} where user_id = #{user_id} and follow_id = #{follow_id}")
    public int updateSpecial(ConcernDto concernDto);
}
